package com.example.common.exception;

import com.example.common.response.ServerCode;
import lombok.Getter;

/**
 * @Description: 参数异常
 * @Auther: Swain
 * @Date: 2021/1/11 16:48
 * @Version 1.0.0
 */
@Getter
public class ParamException extends BaseException {

    private int code;

    private String msg;

    public ParamException(String msg) {
        super(msg);
        this.code = ServerCode.PARAMETER_ERROR.getCode();
        this.msg = msg;
    }

    public ParamException(ServerCode serverCode) {
        super();
        this.code = serverCode.getCode();
        this.msg = serverCode.getDesc();
    }
}
